﻿using System;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;
using OmegaEngine;

namespace OmegaEngine
{
    public class GUICheckBoxLabel : GUIActor
    {
        string text { get; set; }
        GUICheckBox checkBox;
        GUILabelButton label;

        public GUICheckBoxLabel(string Text, int PositionX, int PositionY, int Width, int Height, Color Color, GameScreen Parent)
            : base()
        {
            this.setupCheck(PositionX, PositionY, Width, Height, Color, Parent);
            this.setupLabel(Text, Engine.DefaultFont, (PositionX + Width + 2), (PositionY - 4), Color, Parent);
        }

        public void setupLabel(string Label, SpriteFont Font, int PositionX, int PositionY, Color Color, GameScreen Parent)
        {
            this.label = new GUILabelButton(Label, this.checkBox.ToggleCheck, Font, PositionX, PositionY, Color, Parent);
        }

        public void setupCheck(int PositionX, int PositionY, int Width, int Height, Color Color, GameScreen Parent)
        {
            this.checkBox = new GUICheckBox(Engine.DefaultChecked, Engine.DefaultUnchecked, PositionX, PositionY, Color, Parent); // Change position, etc as needed
        }

        public bool isChecked()
        {
            return this.checkBox.isChecked;
        }

        /*
        public void toggleCheck()
        {
            this.isChecked = !this.isChecked;

            if(this.isChecked)
                this.checkBox.UpdateTexture(this.textureChecked);
            else
                this.checkBox.UpdateTexture(this.textureUnchecked);
        }
        */
    }
}
